package com.hema.auction.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hema.auction.R;
import com.hema.auction.bean.PropertyInfo;
import com.hema.auction.utils.Utils;
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration;

import java.util.List;

/**
 * author by john
 */

public class MyPropertyAdapter extends BaseQuickAdapter<PropertyInfo,BaseViewHolder> implements HorizontalDividerItemDecoration.MarginProvider{
    public MyPropertyAdapter(@Nullable List<PropertyInfo> data) {
        super(R.layout.layout_property_item,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, PropertyInfo item) {
        helper.setText(R.id.tv_title,item.getRemark());
        helper.setText(R.id.tv_date, Utils.timedate(item.getAddTime()));
        helper.setText(R.id.tv_activity,item.getBalanceValue());
    }

    @Override
    public int dividerLeftMargin(int position, RecyclerView parent) {
        return 0;
    }

    @Override
    public int dividerRightMargin(int position, RecyclerView parent) {
        return 0;
    }
}
